perm filename SCALE2.TEX[X,ALS] blob
sn#810387 filedate 1986-02-16 generic text, type C, neo UTF8
COMMENT ā VALID 00002 PAGES
C REC PAGE DESCRIPTION
C00001 00001
C00002 00002 \font\BAS=BASL30
C00025 ENDMK
Cā;
\font\BAS=BASL30
\documentstyle{report} % Specifies the document style.
\documentstyle{rep11}
% The preamble begins here.
\title{A Note on Scaling Binary Typeface Information}
\author{Arthur L. Samuel}
\begin{document} % End of preamble and beginning of text.
\maketitle % Produces the title.
%\twocolumn
This is a report on some work directed toward developing a relatively fast
method of translating a library of 200 pixels per inch typeface fonts into
font files that are usable at 300 pixels per inch or alternately at 384
pixels per inch. The necessary code has also been generated
for translating the font files into the newer GF format and for generating
the related TFM files.
{\BAS
This paragraph was printed using a font, BASL30, that has been through this
process. The output is hardly comparable in quality with the output
produced by using METAFONT generated fonts (as used elsewhere in this
report) or with fonts otherwise
directly designed for use at 300 pixels per inch but at least, as one
typographer remarked, "It is readable".}
\section{Resolution Scaling}
The major concern in this note is to explain the method adopted for
altering the resolution. Although an older program, FSCALE, was already
available for effecting the desired translation, it has been possible to
improve on its speed and to achieve a somewhat higher quality output. The
number of fonts involved and the limited initial resolution made it
impractical to apply one of the more precise methods that have been
described in the literature.
\subsection{Available Methods}
First, a word about the two bounding methods that have been used for
altering the resolution of font files. The better of the two
methods starts with an attempt to reconstruct a continuous image from the
samples provided by the input data. This is then sampled at the desired
resolution. Cubic splines are commonly used for the initial continuous
image generation and the entire process can be quite demanding in terms of
the computation times. At the other extreme, which incidentally works
better for reductions in resolution rather than for increases, are methods
that arbitrarily remove some points of the array or introduce additional
points as required and assign zeros or ones to them as dictated by their
neighbors.
\subsection{The FSCALE Method}
The FSCALE program, referenced above, follows a variation of this second
course. Its action can best be understood by envisioning the superposition
of the two array of points at the two different resolutions with values of
zero or one (white or black) assigned to each point of the input array.
The conversion process then consists of assigning zeros or ones to each of
the points in the output array based on the quantized weighted average of
the values assigned to the neighboring points of the input array. Using
only the value of the nearest neighbor would, of course be the fastest
procedure but this would lead to a very poor quality ouput. FSCALE adopts
the course of referencing the four nearest neighbors.
The FSCALE method does a surprisingly good job but it suffers from one
crucial defect when dealing with changes in resolution as large as 300/200.
This defect comes about because of its failure to take advantage of the
fact that it is dealing with typefaces that follow certain typographic
conventions where the exact treatment to be accorded to any specific
region can depend upon conditions at some distance from the actual point
in question.
\section{The New Method}
Using the framework provided by an older font manipulating program called
FMUNGE and by adding two new commands, it has been possible to implement a
scaling method that is both faster and, in most cases, better than FSCALE
in handling two contrasting situations. These situations are: 1) the
situation where two different strokes join at approximately right angles
and where one does not want to soften the abruptness of the change of
direction, and 2) the situation, most often encountered with diagonal
strokes, where one would like to take advantage of the increased
resolution to smooth the jagged approximation that was the best that could
be done at the lower resolution.
\subsection{How It Works}
There are four steps in the resolution changing process.
The program first stretches the glyph in the horizontal direction by
adding extra points between every other pair of the original points for
the 300/200 case or between every pair of points for the 400/200 case
which is used to approximate the 384/200 needed for the DOVER printer. If
the two neighboring points are both black, the newly introduced point is
set black otherwise it is set white. This is satisfactory for much of the
region but it assigns white to all of the new points that lie on the
glyph's borders.
The program then attends to these newly inserted border points by
referencing a template that identifies these border points and that
differentiates between the two possible states either where the program
should make the point black to smooth the edge or where the abruptness in
the change of direction should be preserved. This template referencing is
done for a full word (36 bits) at a time, so this part of the work is done
very rapidly.
The program then stretches the glyph in the vertical direction by
introducing extra lines as needed, using rules similar to those used in
the horizontal direction.
Finally the program again references a template in assigning values to the
ambiguous points created by the vertical stretching.
\subsection{Comparitive Performance}
This new routine functions remarkedly well in most cases although it can also
fail rather badly on some glyphs so that hand tailoring is sometimes
needed. The program provides for this by producing a printable
star/dot file that can be hand edited and then read by the program and the
results used to produce either a FNT or a GF file (or both) as
desired.
In general, the resulting glyphs are somewhat lighter, that is, have
thinner strokes, than those produced by the FSCALE program but this is
usually to be preferred since the IMAGEN printer, on which the 300-pixel
fonts are to be used, tends to print rather heavily. And, of course, most
of the older XGP fonts were specifically tailored for use at 200 pixels
per inch and this did not allow for the fineness of detail that
one would otherwise like.
The lack of neighbor-specific kerning information for individual
glyphs of the XGP fonts is one deficiency that is not easily overcome. A
still unused mechanism for allowing such information to be introduced is,
however, provided by the present scheme of going from FNT files to PL
files, which can be hand edited, and then in going from PL to TFM.
\section{The Programs and their Documentation}
All of the necessary routines to produce scaled star/dot
files and to reconvert these files into FNT files or into GF
formatted files are contain in the most recent version of the FMUNGE
program on SAIL.
The FMUNGE program is reasonably well documented. Type READ FMUNGE on SAIL
for details. In addition, R FMUNGE produces a split screen when used at
a DD terminal with a condensed listing of the more frequently used
commands on the top half the screen. This is a convenience, since it was not
possible to assign mnemonically related code letters for the three new commands.
An updated FNTPL program (R FNTPL and requiring a 10 answer to one
question) is used to produce PL files and these are then converted to TFM
files using the PLtoTFM program (R PLTOTF).
A DO file, DO FNTFIX[X,ALS], handles all of the necessary details (without
pausing for hand editing) except for the final assigning and renaming of
the files to the [300,SYS], [384,SYS], [GF,SYS], and [TFM,SYS]
directories.
\section{Available Fonts}
The following fonts are currently available for general use, in .FNT form
on [300,SYS], in .300 GF form on [GF,SYS], and with the metrics in .TFM form
on [TFM,SYS] :\ \ \
QUUX25, BASL30, BASL35, BAXM30, MATH30, SUB,
SUP, FIX25, NGR30, GRKB30, ZERO30.
Other fonts will be made available as requested.
\end{document}